package com.superatom.concurrent.basic.daemon;

class ADaemon implements Runnable{
    public void run() {
        System.out.println("Starting ADaemon");
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }finally {
            // finally部分无法执行
            System.out.println("This should always run?");
        }
    }
}

public class DaemonsDontRunFinally{
    public static void main(String[] args){
        Thread t = new Thread(new ADaemon());
        t.setDaemon(true);
        t.start();
    }
}